/**
 */
package ar.edu.phm.tp.cuatro.planificacionDsl.planificacion.impl;

import ar.edu.phm.tp.cuatro.planificacionDsl.planificacion.*;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class PlanificacionFactoryImpl extends EFactoryImpl implements PlanificacionFactory
{
  /**
   * Creates the default factory implementation.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public static PlanificacionFactory init()
  {
    try
    {
      PlanificacionFactory thePlanificacionFactory = (PlanificacionFactory)EPackage.Registry.INSTANCE.getEFactory(PlanificacionPackage.eNS_URI);
      if (thePlanificacionFactory != null)
      {
        return thePlanificacionFactory;
      }
    }
    catch (Exception exception)
    {
      EcorePlugin.INSTANCE.log(exception);
    }
    return new PlanificacionFactoryImpl();
  }

  /**
   * Creates an instance of the factory.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public PlanificacionFactoryImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public EObject create(EClass eClass)
  {
    switch (eClass.getClassifierID())
    {
      case PlanificacionPackage.MODEL: return createModel();
      case PlanificacionPackage.ENTIDAD: return createEntidad();
      case PlanificacionPackage.PLAN: return createPlan();
      case PlanificacionPackage.AULA: return createAula();
      case PlanificacionPackage.MATERIA: return createMateria();
      case PlanificacionPackage.DOCENTE: return createDocente();
      case PlanificacionPackage.DIA: return createDia();
      case PlanificacionPackage.ASIGNACION: return createAsignacion();
      case PlanificacionPackage.EXCLUSIVA: return createExclusiva();
      case PlanificacionPackage.SEMI: return createSemi();
      case PlanificacionPackage.SIMPLE: return createSimple();
      default:
        throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object createFromString(EDataType eDataType, String initialValue)
  {
    switch (eDataType.getClassifierID())
    {
      case PlanificacionPackage.TIPO_RECURSO:
        return createTipoRecursoFromString(eDataType, initialValue);
      case PlanificacionPackage.NOMBRE_DIA:
        return createNombreDiaFromString(eDataType, initialValue);
      case PlanificacionPackage.CUATRIMESTRE:
        return createCuatrimestreFromString(eDataType, initialValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String convertToString(EDataType eDataType, Object instanceValue)
  {
    switch (eDataType.getClassifierID())
    {
      case PlanificacionPackage.TIPO_RECURSO:
        return convertTipoRecursoToString(eDataType, instanceValue);
      case PlanificacionPackage.NOMBRE_DIA:
        return convertNombreDiaToString(eDataType, instanceValue);
      case PlanificacionPackage.CUATRIMESTRE:
        return convertCuatrimestreToString(eDataType, instanceValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Model createModel()
  {
    ModelImpl model = new ModelImpl();
    return model;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Entidad createEntidad()
  {
    EntidadImpl entidad = new EntidadImpl();
    return entidad;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Plan createPlan()
  {
    PlanImpl plan = new PlanImpl();
    return plan;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Aula createAula()
  {
    AulaImpl aula = new AulaImpl();
    return aula;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Materia createMateria()
  {
    MateriaImpl materia = new MateriaImpl();
    return materia;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Docente createDocente()
  {
    DocenteImpl docente = new DocenteImpl();
    return docente;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Dia createDia()
  {
    DiaImpl dia = new DiaImpl();
    return dia;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Asignacion createAsignacion()
  {
    AsignacionImpl asignacion = new AsignacionImpl();
    return asignacion;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Exclusiva createExclusiva()
  {
    ExclusivaImpl exclusiva = new ExclusivaImpl();
    return exclusiva;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Semi createSemi()
  {
    SemiImpl semi = new SemiImpl();
    return semi;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Simple createSimple()
  {
    SimpleImpl simple = new SimpleImpl();
    return simple;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public TipoRecurso createTipoRecursoFromString(EDataType eDataType, String initialValue)
  {
    TipoRecurso result = TipoRecurso.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertTipoRecursoToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NombreDia createNombreDiaFromString(EDataType eDataType, String initialValue)
  {
    NombreDia result = NombreDia.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertNombreDiaToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Cuatrimestre createCuatrimestreFromString(EDataType eDataType, String initialValue)
  {
    Cuatrimestre result = Cuatrimestre.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertCuatrimestreToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public PlanificacionPackage getPlanificacionPackage()
  {
    return (PlanificacionPackage)getEPackage();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @deprecated
   * @generated
   */
  @Deprecated
  public static PlanificacionPackage getPackage()
  {
    return PlanificacionPackage.eINSTANCE;
  }

} //PlanificacionFactoryImpl
